import { Node_CONTRACT, NodeABI, Stake_CONTRACT, StakeABI, fullHost } from './index'
import { TronWeb, utils as TronWebUtils, Trx, TransactionBuilder, Contract, Event, Plugin } from 'tronweb';

export const GetNodeUSDT = async (curCount) => {
    const tronWeb = new TronWeb({
        fullHost: fullHost,
    })
    tronWeb.setAddress(Node_CONTRACT)
    return tronWeb
        .contract(NodeABI, Node_CONTRACT)
        .getNodeUSDT(curCount)
        .call()
}

export const deposit = async (payable) => {
    return tronWeb
        .contract(StakeABI, Stake_CONTRACT)
        .deposit()
        .send({ callValue: payable })
}
